package com.lanou.pianke.admin.web.controller;

import com.lanou.pianke.admin.entity.Preply;
import com.lanou.pianke.admin.service.PreplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/")
public class PreplyController {
    @Autowired
    private PreplyService preplyService;

    // 显示所有被举报的回复
    @GetMapping("showReplyReported")
    public List<Preply> showReplyReported(){
        return preplyService.showReported();
    }

    // 删除回复评论
    @DeleteMapping("deleteReply")
    public void deleteReply(){
        preplyService.deleteByReported();
    }
}
